package com.beta.service;


import com.baomidou.framework.service.ISuperService;
import com.baomidou.mybatisplus.plugins.Page;
import com.beta.dto.order.OrderItemDto;
import com.beta.entity.OrderItems;
import com.beta.dto.order.RefundItemDto;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * OrderItems 表数据服务层接口
 */
public interface IOrderItemsService extends ISuperService<OrderItems> {

    String getOrderItemName(OrderItems orderItems);

    List<OrderItemDto> getOrdersItemsByOrderId(Integer orderId);

    List<OrderItemDto> getOrderItemByCartItemIds(List<Integer> cartItemsId);

    Map<Integer, List<OrderItemDto>> getOrdersItemsBatchByOrderIds(List<Integer> orderIds);

    void executeAgreeRefundItem(Integer refundId);

    Page<RefundItemDto> getRefundItems(Integer userId, String status, Page<RefundItemDto> page);

    Page<RefundItemDto> getAllRefundItems(Integer userId, Page<RefundItemDto> page);

    void executeReject(Integer orderItemId, BigDecimal refundRate,Integer currentUserId);

    /**
     * 获得订单的订单项列表
     *
     * @param orderId
     * @return
     */
    List<OrderItems> getOrderItemsByOrderId(Integer orderId);

    /**
     * 获得订单中退款的订单项
     * @param orderId
     * @return
     */
    List<OrderItems> getRefundItems(Integer orderId);

    /**
     * 获得订单中退款同意的订单项
     * @param orderId
     * @return
     */
    List<OrderItems> getRefundAgreeItems(Integer orderId);

    /**
     * 获得订单中确认收货的订单项
     * @param orderId
     * @return
     */
    List<OrderItems> getAcceptedItems(Integer orderId);

    void executeUnReject(Integer orderItemId, Integer currentUserId);

    boolean getRejectable(Integer orderItemId);

    boolean getRejectable(OrderItemDto orderItemDto);

    boolean getUnrejectable(Integer orderItemId);

}